<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>01_BOM操作</title>
</head>
<body>
<button onclick = "alert('请先登录!')">弹出警告框</button>
<button onclick = "confirm('是否确定删除?')">弹出确认框</button>
<script>
    //window是浏览器内置的全局对象,无需创建或导包,可以直接使用其属性与方法
    //parseInt()将参数转换为整数,如果得不到数字结果,会的到NaN
    console.log(parseInt(6.1));
    console.log(parseInt(6.9));
    console.log(parseInt(6));
    console.log(parseInt('6.99'));
    console.log(parseInt('hhh'));
    //parseFloat()将参数转换为浮点数,如果得不到数字结果,会得到NaN
    console.log(parseFloat(6.1));
    console.log(parseFloat(6.9));
    console.log(parseFloat(6));
    console.log(parseFloat('6.99'));
    console.log(parseFloat('hhh'));

    //isNaN()判断参数是否为非数字,如果参数为非数字返回true,否则返回false
    console.log(isNaN(123));
    console.log(isNaN(6.6));
    console.log(isNaN('123'));
    console.log(isNaN('hhh'));//true
</script>
</body>
</html>